/*
 * @Description: 问卷模块-接口
 * @Author: xinqiao lxq1990.0716@qq.com
 * @Date: 2024-04-16
 * @LastEditors: xinqiao lxq1990.0716@qq.com
 * @LastEditTime: 2024-04-16
 */
import { get, post } from '@/api/request'

/** 获取问卷表单信息 */
export const requestUnAuthApiJson = (fileName: string) =>
  get<ApiJsonTypes.IRequest, IBaseResponse<ApiJsonTypes.IResponse>>(`/content/survey/unAuth/api/json/V2/${fileName}.json`, {})

/** 答卷前置动作 */
export const requestCheckVoucher = (data: CheckVoucherTypes.IRequest) =>
  post<CheckVoucherTypes.IRequest, IBaseResponse<CheckVoucherTypes.IResponse>>('/content/survey/checkVoucher', data)

/** 用户交卷 */
export const requestSaveAnswer = (data: SaveAnswerTypes.IRequest) =>
  post<SaveAnswerTypes.IRequest, IBaseResponse<SaveAnswerTypes.IResponse>>('/content/survey/saveAnswer', data)

/** 根据recordId获取表单信息 */
export const requestGetMyPaperDetail = (data: GetMyPaperDetailTypes.IRequest) =>
  post<GetMyPaperDetailTypes.IRequest, IBaseResponse<GetMyPaperDetailTypes.IResponse>>('/content/survey/getMyPaperDetail', data)
